﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RealtyManagementSystem.DAL;

namespace RealtyManagementSystem.BLL
{
    public class HouseholdProvider:IDisposable
    {
        private realtydbEntities _realtyContext = null;

        public HouseholdProvider()
        {
            _realtyContext = new realtydbEntities();
        }

        public void Add(Household household)
        {
            _realtyContext.AddObject("Households", household);
            _realtyContext.SaveChanges();
        }

        #region Dispose
        private bool disposedValue = false;

        protected virtual void Dispose(bool disposing)
        {
            if (!this.disposedValue)
            {
                if (disposing)
                {
                    _realtyContext.Dispose();
                }
            }
            this.disposedValue = true;
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        #endregion

    }//end class
}
